home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / filestuf.lzh / EXAMPLE.CMD < prev    next >
OS/2 REXX Batch file  |  1990-08-22  |  4KB  |  174 lines

  1. ;First thing to do here is clear the screen so we start out nice. :-)
  2. s E
  3. s
  4. s            p Filestuff Example Script q
  5. s
  6. s
  7. s Ok, let's go on a quick tour! First, we'll see how to check for a particular
  8. s keypress. When I say so, you press a key and I'll tell you which one it was.
  9. s For this demo, I'll only check for the first three letters, numbers, and
  10. s function keys, the ESCape key, and the "special" keys.
  11. s
  12. b
  13. p 15
  14. @ 3
  15. buffer
  16. s All set? Ok, press a key within 15 seconds!
  17. pause 15
  18. s
  19. keyget
  20. ifkey 1 11        numbers...
  21. i 2 12
  22. i 3 13
  23. i  14 note: there's an ESC between "i" and "14" here!
  24. i a 15            letters...
  25. i A 16
  26. i b 17
  27. i B 18
  28. i c 19
  29. i C 20
  30. i /1 21           function keys...
  31. i /2 22
  32. i /3 23
  33. i /help 24        special keys...
  34. i /return 25
  35. i /space 26
  36. i /undo 27
  37. i /any 28
  38. i /none 29
  39. s
  40. s I check for both "any key" and "no key" above, so you shouldn't ever
  41. s see this message! If you do, something's not right!
  42. j 30
  43. @ 11
  44. s You pressed p 1 q!
  45. j 30
  46. @ 12
  47. s You pressed p 2 q!
  48. j 30
  49. @ 13
  50. s You pressed p 3 q!
  51. j 30
  52. @ 14
  53. s You pressed the p ESC q key!
  54. j 30
  55. @ 15
  56. s You pressed p a q!
  57. j 30
  58. @ 16
  59. s You pressed p shift-A q!
  60. j 30
  61. @ 17
  62. s You pressed p b q!
  63. j 30
  64. @ 18
  65. s You pressed p shift-B q!
  66. j 30
  67. @ 19
  68. s You pressed p c q!
  69. j 30
  70. @ 20
  71. s You pressed p shift-C q!
  72. j 30
  73. @ 21
  74. s You pressed p F1 q!
  75. j 30
  76. @ 22
  77. s You pressed p F2 q!
  78. j 30
  79. @ 23
  80. s You pressed p F3 q!
  81. j 30
  82. @ 24
  83. s You pressed p Help q!
  84. j 30
  85. @ 25
  86. s You pressed p Return q or p Enter q!
  87. j 30
  88. @ 26
  89. s You pressed the p space bar q!
  90. j 30
  91. @ 27
  92. s You pressed p Undo q!
  93. j 30
  94. @ 28
  95. s You pressed p some other key q!
  96. j 30
  97. @ 29
  98. v +
  99. s You didn't press any key at all! 
  100. v -
  101. ;
  102. @ 30 This is the end of the keypress test.
  103. ;
  104. s
  105. s If you want to try again, press the p space bar q within 10 seconds.
  106. s Otherwise we'll go on to something else.
  107. buffer
  108. pause 10
  109. ketget
  110. s
  111. i /s 3 (go back for more key testing)
  112. ;---------------------------
  113. s Ok, here's something else...
  114. hirez 35
  115. medrez 36
  116. lowrez 37
  117. s You're not in low, medium, or high rez... got a Moniterm, maybe?
  118. j 38
  119. @ 35
  120. s You're running in monochrome right now!
  121. j 38
  122. @ 36
  123. s You're running in medium rez right now!
  124. j 38
  125. @ 37
  126. s You're running in low rez right now!
  127. @ 38
  128. s
  129. s Filestuff can determine what resolution your ST is in, and branch to a
  130. s particular label depending on what rez it is. This could be useful if a
  131. s program you want to run needs different configuration files for each rez.
  132. s
  133. b
  134. p 10
  135. ;---------------------------
  136. s Ok, now that that's done let me show you some of the things you can do
  137. s using the SHOW command. You can use the VIDEO command to...
  138. video +
  139. s
  140. s     turn reverse video on (with "VIDEO +" or "V +")... 
  141. ;
  142. ;Note: there's a TAB character between the "s" and the "turn" above...
  143. ;Tabs only move the cursor (they aren't really "displayed"), so they
  144. ;don't show up when you're in reverse video. The title uses tabs too.
  145. ;
  146. v -
  147. s
  148. s or turn reverse video back off (with "VIDEO -" or "V -").
  149. b
  150. p 10
  151. s
  152. s You can also embed VT-52 control codes in a SHOW command. That's how I
  153. s cleared the screen above - I included an p ESC-E q in my SHOW. You could also
  154. s embed p ESC-p q to switch reverse video on, or p ESC-q q to turn it off; it's
  155. s a handy way of highlighting important information. Other VT-52 codes will
  156. s work too.
  157. b
  158. p 15
  159. ;---------------------------
  160. s
  161. s That's the end of this example script; now we'll Transfer control to our
  162. s second example to demonstrate the File Commands. When we transferred to
  163. s this script, recall that the actual command line was displayed on screen.
  164. s If you wish, you can disable this command line 'echo' and display a more
  165. s informative message - all it takes is the "ECHO -" command. I'll disable
  166. s the echo now, and move on to the next script...
  167. s
  168. b
  169. p 15
  170. echo -
  171. b
  172. s Transferring control to second example...
  173. t \example2.cmd  --  Transfer control to our second example script...
  174.